package com.di.base.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.di.base.entity.AccountTbl;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.lang.Double;
import java.lang.Double;

/**
 * (AccountTbl)表服务接口
 *
 * @author makejava
 * @since 2025-07-08 22:45:18
 */
@LocalTCC
public interface AccountTblService extends IService<AccountTbl> {
    @TwoPhaseBusinessAction(name = "accountTccAction", commitMethod = "commit", rollbackMethod = "rollback")
    boolean prepareDecreaseAccount(BusinessActionContext context,
                                   @BusinessActionContextParameter(paramName = "userId") String userId,
                                   @BusinessActionContextParameter(paramName = "amount")Double amount);

    boolean commit(BusinessActionContext context);

    boolean rollback(BusinessActionContext context);
}

